home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 6 / CU Amiga Magazine's Super CD-ROM 06 (1996)(EMAP Images)(GB)(Track 1 of 4)[!][issue 1997-01].iso / cucd / prog / gnu-c / src / gcc-2.7.0-amiga / gcc.info-7 (.txt) < prev    next >
GNU Info File  |  1995-06-16  |  50KB  |  908 lines

  1. This is Info file gcc.info, produced by Makeinfo-1.55 from the input
  2. file gcc.texi.
  3.    This file documents the use and the internals of the GNU compiler.
  4.    Published by the Free Software Foundation 59 Temple Place - Suite 330
  5. Boston, MA 02111-1307 USA
  6.    Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995 Free Software
  7. Foundation, Inc.
  8.    Permission is granted to make and distribute verbatim copies of this
  9. manual provided the copyright notice and this permission notice are
  10. preserved on all copies.
  11.    Permission is granted to copy and distribute modified versions of
  12. this manual under the conditions for verbatim copying, provided also
  13. that the sections entitled "GNU General Public License," "Funding for
  14. Free Software," and "Protect Your Freedom--Fight `Look And Feel'" are
  15. included exactly as in the original, and provided that the entire
  16. resulting derived work is distributed under the terms of a permission
  17. notice identical to this one.
  18.    Permission is granted to copy and distribute translations of this
  19. manual into another language, under the above conditions for modified
  20. versions, except that the sections entitled "GNU General Public
  21. License," "Funding for Free Software," and "Protect Your Freedom--Fight
  22. `Look And Feel'", and this permission notice, may be included in
  23. translations approved by the Free Software Foundation instead of in the
  24. original English.
  25. File: gcc.info,  Node: Configurations,  Next: Other Dir,  Up: Installation
  26. Configurations Supported by GNU CC
  27. ==================================
  28.    Here are the possible CPU types:
  29.      1750a, a29k, alpha, arm, cN, clipper, dsp16xx, elxsi, h8300,
  30.      hppa1.0, hppa1.1, i370, i386, i486, i586, i860, i960, m68000, m68k,
  31.      m88k, mips, mipsel, mips64, mips64el, ns32k, powerpc, powerpcle,
  32.      pyramid, romp, rs6000, sh, sparc, sparclite, sparc64, vax, we32k.
  33.    Here are the recognized company names.  As you can see, customary
  34. abbreviations are used rather than the longer official names.
  35.      acorn, alliant, altos, apollo, att, bull, cbm, convergent, convex,
  36.      crds, dec, dg, dolphin, elxsi, encore, harris, hitachi, hp, ibm,
  37.      intergraph, isi, mips, motorola, ncr, next, ns, omron, plexus,
  38.      sequent, sgi, sony, sun, tti, unicom, wrs.
  39.    The company name is meaningful only to disambiguate when the rest of
  40. the information supplied is insufficient.  You can omit it, writing
  41. just `CPU-SYSTEM', if it is not needed.  For example, `vax-ultrix4.2'
  42. is equivalent to `vax-dec-ultrix4.2'.
  43.    Here is a list of system types:
  44.      386bsd, aix, acis, amigados, aos, aout, bosx, bsd, clix, coff,
  45.      ctix, cxux, dgux, dynix, ebmon, ecoff, elf, esix, freebsd, hms,
  46.      genix, gnu, gnu/linux, hiux, hpux, iris, irix, isc, luna, lynxos,
  47.      mach, minix, msdos, mvs, netbsd, newsos, nindy, ns, osf, osfrose,
  48.      ptx, riscix, riscos, rtu, sco, sim, solaris, sunos, sym, sysv,
  49.      udi, ultrix, unicos, uniplus, unos, vms, vsta, vxworks, winnt,
  50.      xenix.
  51. You can omit the system type; then `configure' guesses the operating
  52. system from the CPU and company.
  53.    You can add a version number to the system type; this may or may not
  54. make a difference.  For example, you can write `bsd4.3' or `bsd4.4' to
  55. distinguish versions of BSD.  In practice, the version number is most
  56. needed for `sysv3' and `sysv4', which are often treated differently.
  57.    If you specify an impossible combination such as `i860-dg-vms', then
  58. you may get an error message from `configure', or it may ignore part of
  59. the information and do the best it can with the rest.  `configure'
  60. always prints the canonical name for the alternative that it used.  GNU
  61. CC does not support all possible alternatives.
  62.    Often a particular model of machine has a name.  Many machine names
  63. are recognized as aliases for CPU/company combinations.  Thus, the
  64. machine name `sun3', mentioned above, is an alias for `m68k-sun'.
  65. Sometimes we accept a company name as a machine name, when the name is
  66. popularly used for a particular machine.  Here is a table of the known
  67. machine names:
  68.      3300, 3b1, 3bN, 7300, altos3068, altos, apollo68, att-7300,
  69.      balance, convex-cN, crds, decstation-3100, decstation, delta,
  70.      encore, fx2800, gmicro, hp7NN, hp8NN, hp9k2NN, hp9k3NN, hp9k7NN,
  71.      hp9k8NN, iris4d, iris, isi68, m3230, magnum, merlin, miniframe,
  72.      mmax, news-3600, news800, news, next, pbd, pc532, pmax, powerpc,
  73.      powerpcle, ps2, risc-news, rtpc, sun2, sun386i, sun386, sun3,
  74.      sun4, symmetry, tower-32, tower.
  75. Remember that a machine name specifies both the cpu type and the company
  76. name.  If you want to install your own homemade configuration files,
  77. you can use `local' as the company name to access them.  If you use
  78. configuration `CPU-local', the configuration name without the cpu prefix
  79. is used to form the configuration file names.
  80.    Thus, if you specify `m68k-local', configuration uses files
  81. `m68k.md', `local.h', `m68k.c', `xm-local.h', `t-local', and `x-local',
  82. all in the directory `config/m68k'.
  83.    Here is a list of configurations that have special treatment or
  84. special things you must know:
  85. `1750a-*-*'
  86.      MIL-STD-1750A processors.
  87.      Starting with GCC 2.6.1, the MIL-STD-1750A cross configuration no
  88.      longer supports the Tektronix Assembler, but instead produces
  89.      output for `as1750', an assembler/linker available under the GNU
  90.      Public License for the 1750A. Contact *okellogg@salyko.cube.net*
  91.      for more details on obtaining `as1750'.  A similarly licensed
  92.      simulator for the 1750A is available from same address.
  93.      You should ignore a fatal error during the building of libgcc
  94.      (libgcc is not yet implemented for the 1750A.)
  95.      The `as1750' assembler requires the file `ms1750.inc', which is
  96.      found in the directory `config/1750a'.
  97.      GNU CC produced the same sections as the Fairchild F9450 C
  98.      Compiler, namely:
  99.     `NREL'
  100.           The program code section.
  101.     `SREL'
  102.           The read/write (RAM) data section.
  103.     `KREL'
  104.           The read-only (ROM) constants section.
  105.     `IREL'
  106.           Initialization section (code to copy KREL to SREL).
  107.      The smallest addressable unit is 16 bits (BITS_PER_UNIT is 16).
  108.      This means that type `char' is represented with a 16-bit word per
  109.      character.  The 1750A's "Load/Store Upper/Lower Byte" instructions
  110.      are not used by GNU CC.
  111.      There is a problem with long argument lists to functions.  The
  112.      compiler aborts if the sum of space needed by all arguments
  113.      exceeds 14 words.  This is because the arguments are passed in
  114.      registers (R0..R13) not on the stack, and there is a problem with
  115.      passing further arguments (i.e.  beyond those in R0..R13) via the
  116.      stack.
  117.      If efficiency is less important than using long argument lists, you
  118.      can change the definition of the `FUNCTION_ARG' macro in
  119.      `config/1750/1750a.h' to always return zero.  If you do that, GNU
  120.      CC will pass all parameters on the stack.
  121. `alpha-*-osf1'
  122.      Systems using processors that implement the DEC Alpha architecture
  123.      and are running the OSF/1 operating system, for example the DEC
  124.      Alpha AXP systems.  (VMS on the Alpha is not currently supported
  125.      by GNU CC.)
  126.      GNU CC writes a `.verstamp' directive to the assembler output file
  127.      unless it is built as a cross-compiler.  It gets the version to
  128.      use from the system header file `/usr/include/stamp.h'.  If you
  129.      install a new version of OSF/1, you should rebuild GCC to pick up
  130.      the new version stamp.
  131.      Note that since the Alpha is a 64-bit architecture,
  132.      cross-compilers from 32-bit machines will not generate code as
  133.      efficient as that generated when the compiler is running on a
  134.      64-bit machine because many optimizations that depend on being
  135.      able to represent a word on the target in an integral value on the
  136.      host cannot be performed.  Building cross-compilers on the Alpha
  137.      for 32-bit machines has only been tested in a few cases and may
  138.      not work properly.
  139.      `make compare' may fail on old versions of OSF/1 unless you add
  140.      `-save-temps' to `CFLAGS'.  On these systems, the name of the
  141.      assembler input file is stored in the object file, and that makes
  142.      comparison fail if it differs between the `stage1' and `stage2'
  143.      compilations.  The option `-save-temps' forces a fixed name to be
  144.      used for the assembler input file, instead of a randomly chosen
  145.      name in `/tmp'.  Do not add `-save-temps' unless the comparisons
  146.      fail without that option.  If you add `-save-temps', you will have
  147.      to manually delete the `.i' and `.s' files after each series of
  148.      compilations.
  149.      GNU CC now supports both the native (ECOFF) debugging format used
  150.      by DBX and GDB and an encapsulated STABS format for use only with
  151.      GDB.  See the discussion of the `--with-stabs' option of
  152.      `configure' above for more information on these formats and how to
  153.      select them.
  154.      There is a bug in DEC's assembler that produces incorrect line
  155.      numbers for ECOFF format when the `.align' directive is used.  To
  156.      work around this problem, GNU CC will not emit such alignment
  157.      directives while writing ECOFF format debugging information even
  158.      if optimization is being performed.  Unfortunately, this has the
  159.      very undesirable side-effect that code addresses when `-O' is
  160.      specified are different depending on whether or not `-g' is also
  161.      specified.
  162.      To avoid this behavior, specify `-gstabs+' and use GDB instead of
  163.      DBX.  DEC is now aware of this problem with the assembler and
  164.      hopes to provide a fix shortly.
  165. `arm'
  166.      Advanced RISC Machines ARM-family processors.  These are often
  167.      used in embedded applications.  There are no standard Unix
  168.      configurations.  This configuration corresponds to the basic
  169.      instruction sequences and will produce a.out format object modules.
  170.      You may need to make a variant of the file `arm.h' for your
  171.      particular configuration.
  172. `arm-*-riscix'
  173.      The ARM2 or ARM3 processor running RISC iX, Acorn's port of BSD
  174.      Unix.  If you are running a version of RISC iX prior to 1.2 then
  175.      you must specify the version number during configuration.  Note
  176.      that the assembler shipped with RISC iX does not support stabs
  177.      debugging information; a new version of the assembler, with stabs
  178.      support included, is now available from Acorn.
  179. `a29k'
  180.      AMD Am29k-family processors.  These are normally used in embedded
  181.      applications.  There are no standard Unix configurations.  This
  182.      configuration corresponds to AMD's standard calling sequence and
  183.      binary interface and is compatible with other 29k tools.
  184.      You may need to make a variant of the file `a29k.h' for your
  185.      particular configuration.
  186. `a29k-*-bsd'
  187.      AMD Am29050 used in a system running a variant of BSD Unix.
  188. `decstation-*'
  189.      DECstations can support three different personalities: Ultrix, DEC
  190.      OSF/1, and OSF/rose.  To configure GCC for these platforms use the
  191.      following configurations:
  192.     `decstation-ultrix'
  193.           Ultrix configuration.
  194.     `decstation-osf1'
  195.           Dec's version of OSF/1.
  196.     `decstation-osfrose'
  197.           Open Software Foundation reference port of OSF/1 which uses
  198.           the OSF/rose object file format instead of ECOFF.  Normally,
  199.           you would not select this configuration.
  200.      The MIPS C compiler needs to be told to increase its table size
  201.      for switch statements with the `-Wf,-XNg1500' option in order to
  202.      compile `cp/parse.c'.  If you use the `-O2' optimization option,
  203.      you also need to use `-Olimit 3000'.  Both of these options are
  204.      automatically generated in the `Makefile' that the shell script
  205.      `configure' builds.  If you override the `CC' make variable and
  206.      use the MIPS compilers, you may need to add `-Wf,-XNg1500 -Olimit
  207.      3000'.
  208. `elxsi-elxsi-bsd'
  209.      The Elxsi's C compiler has known limitations that prevent it from
  210.      compiling GNU C.  Please contact `mrs@cygnus.com' for more details.
  211. `dsp16xx'
  212.      A port to the AT&T DSP1610 family of processors.
  213. `h8300-*-*'
  214.      The calling convention and structure layout has changed in release
  215.      2.6.  All code must be recompiled.  The calling convention now
  216.      passes the first three arguments in function calls in registers.
  217.      Structures are no longer a multiple of 2 bytes.
  218. `hppa*-*-*'
  219.      There are two variants of this CPU, called 1.0 and 1.1, which have
  220.      different machine descriptions.  You must use the right one for
  221.      your machine.  All 7NN machines and 8N7 machines use 1.1, while
  222.      all other 8NN machines use 1.0.
  223.      The easiest way to handle this problem is to use `configure hpNNN'
  224.      or `configure hpNNN-hpux', where NNN is the model number of the
  225.      machine.  Then `configure' will figure out if the machine is a 1.0
  226.      or 1.1.  Use `uname -a' to find out the model number of your
  227.      machine.
  228.      `-g' does not work on HP-UX, since that system uses a peculiar
  229.      debugging format which GNU CC does not know about.  However, `-g'
  230.      will work if you also use GAS and GDB in conjunction with GCC.  We
  231.      highly recommend using GAS for all HP-PA configurations.
  232.      You should be using GAS-2.3 (or later) along with GDB-4.12 (or
  233.      later).  These can be retrieved from all the traditional GNU ftp
  234.      archive sites.
  235.      Build GAS and install the resulting binary as:
  236.           /usr/local/lib/gcc-lib/CONFIGURATION/GCCVERSION/as
  237.      where CONFIGURATION is the configuration name (perhaps
  238.      `hpNNN-hpux') and GCCVERSION is the GNU CC version number.  Do
  239.      this *before* starting the build process, otherwise you will get
  240.      errors from the HPUX assembler while building `libgcc2.a'.  The
  241.      command
  242.           make install-dir
  243.      will create the necessary directory hierarchy so you can install
  244.      GAS before building GCC.
  245.      To enable debugging, configure GNU CC with the `--with-gnu-as'
  246.      option before building.
  247.      It has been reported that GNU CC produces invalid assembly code for
  248.      1.1 machines running HP-UX 8.02 when using the HP assembler.
  249.      Typically the errors look like this:
  250.           as: bug.s @line#15 [err#1060]
  251.             Argument 0 or 2 in FARG upper
  252.                    - lookahead = ARGW1=FR,RTNVAL=GR
  253.           as: foo.s @line#28 [err#1060]
  254.             Argument 0 or 2 in FARG upper
  255.                    - lookahead = ARGW1=FR
  256.      You can check the version of HP-UX you are running by executing
  257.      the command `uname -r'.   If you are indeed running HP-UX 8.02 on
  258.      a PA and using the HP assembler then configure GCC with
  259.      "hpNNN-hpux8.02".
  260. `i370-*-*'
  261.      This port is very preliminary and has many known bugs.  We hope to
  262.      have a higher-quality port for this machine soon.
  263. `i386-*-linuxoldld'
  264.      Use this configuration to generate a.out binaries on Linux if you
  265.      do not have gas/binutils version 2.5.2 or later installed. This is
  266.      an obsolete configuration.
  267. `i386-*-linuxaout'
  268.      Use this configuration to generate a.out binaries on Linux. This
  269.      is an obsolete configuration.  You must use gas/binutils version
  270.      2.5.2 or later.
  271. `i386-*-linux'
  272.      Use this configuration to generate ELF binaries on Linux.  You must
  273.      use gas/binutils version 2.5.2 or later.
  274. `i386-*-sco'
  275.      Compilation with RCC is recommended.  Also, it may be a good idea
  276.      to link with GNU malloc instead of the malloc that comes with the
  277.      system.
  278. `i386-*-sco3.2v4'
  279.      Use this configuration for SCO release 3.2 version 4.
  280. `i386-*-isc'
  281.      It may be a good idea to link with GNU malloc instead of the
  282.      malloc that comes with the system.
  283.      In ISC version 4.1, `sed' core dumps when building `deduced.h'.
  284.      Use the version of `sed' from version 4.0.
  285. `i386-*-esix'
  286.      It may be good idea to link with GNU malloc instead of the malloc
  287.      that comes with the system.
  288. `i386-ibm-aix'
  289.      You need to use GAS version 2.1 or later, and and LD from GNU
  290.      binutils version 2.2 or later.
  291. `i386-sequent-bsd'
  292.      Go to the Berkeley universe before compiling.  In addition, you
  293.      probably need to create a file named `string.h' containing just
  294.      one line: `#include <strings.h>'.
  295. `i386-sequent-ptx1*'
  296.      Sequent DYNIX/ptx 1.x.
  297. `i386-sequent-ptx2*'
  298.      Sequent DYNIX/ptx 2.x.
  299. `i386-sun-sunos4'
  300.      You may find that you need another version of GNU CC to begin
  301.      bootstrapping with, since the current version when built with the
  302.      system's own compiler seems to get an infinite loop compiling part
  303.      of `libgcc2.c'.  GNU CC version 2 compiled with GNU CC (any
  304.      version) seems not to have this problem.
  305.      See *Note Sun Install::, for information on installing GNU CC on
  306.      Sun systems.
  307. `i[345]86-*-winnt3.5'
  308.      This version requires a GAS that has not let been released.  Until
  309.      it is, you can get a prebuilt binary version via anonymous ftp from
  310.      `cs.washington.edu:pub/gnat' or `cs.nyu.edu:pub/gnat'. You must
  311.      also use the Microsoft header files from the Windows NT 3.5 SDK.
  312.      Find these on the CDROM in the `/mstools/h' directory dated
  313.      9/4/94.  You must use a fixed version of Microsoft linker made
  314.      especially for NT 3.5, which is also is available on the NT 3.5
  315.      SDK CDROM.  If you do not have this linker, can you also use the
  316.      linker from Visual C/C++ 1.0 or 2.0.
  317.      Installing GNU CC for NT builds a wrapper linker, called `ld.exe',
  318.      which mimics the behaviour of Unix `ld' in the specification of
  319.      libraries (`-L' and `-l').  `ld.exe' looks for both Unix and
  320.      Microsoft named libraries.  For example, if you specify `-lfoo',
  321.      `ld.exe' will look first for `libfoo.a' and then for `foo.lib'.
  322.      You may install GNU CC for Windows NT in one of two ways,
  323.      depending on whether or not you have a Unix-like shell and various
  324.      Unix-like utilities.
  325.        1. If you do not have a Unix-like shell and few Unix-like
  326.           utilities, you will use a DOS style batch script called
  327.           `configure.bat'.  Invoke it as `configure winnt' from an
  328.           MSDOS console window or from the program manager dialog box.
  329.           `configure.bat' assumes you have already installed and have
  330.           in your path a Unix-like `sed' program which is used to
  331.           create a working `Makefile' from `Makefile.in'.
  332.           `Makefile' uses the Microsoft Nmake program maintenance
  333.           utility and the Visual C/C++ V8.00 compiler to build GNU CC.
  334.           You need only have the utilities `sed' and `touch' to use
  335.           this installation method, which only automatically builds the
  336.           compiler itself.  You must then examine what `fixinc.winnt'
  337.           does, edit the header files by hand and build `libgcc.a'
  338.           manually.
  339.        2. The second type of installation assumes you are running a
  340.           Unix-like shell, have a complete suite of Unix-like utilities
  341.           in your path, and have a previous version of GNU CC already
  342.           installed, either through building it via the above
  343.           installation method or acquiring a pre-built binary.  In this
  344.           case, use the `configure' script in the normal fashion.
  345. `i860-intel-osf1'
  346.      This is the Paragon.  If you have version 1.0 of the operating
  347.      system, see *Note Installation Problems::, for special things you
  348.      need to do to compensate for peculiarities in the system.
  349. `*-lynx-lynxos'
  350.      LynxOS 2.2 and earlier comes with GNU CC 1.x already installed as
  351.      `/bin/gcc'.  You should compile with this instead of `/bin/cc'.
  352.      You can tell GNU CC to use the GNU assembler and linker, by
  353.      specifying `--with-gnu-as --with-gnu-ld' when configuring.  These
  354.      will produce COFF format object files and executables;  otherwise
  355.      GNU CC will use the installed tools, which produce a.out format
  356.      executables.
  357. `m68000-hp-bsd'
  358.      HP 9000 series 200 running BSD.  Note that the C compiler that
  359.      comes with this system cannot compile GNU CC; contact
  360.      `law@cs.utah.edu' to get binaries of GNU CC for bootstrapping.
  361. `m68k-altos'
  362.      Altos 3068.  You must use the GNU assembler, linker and debugger.
  363.      Also, you must fix a kernel bug.  Details in the file
  364.      `README.ALTOS'.
  365. `m68k-att-sysv'
  366.      AT&T 3b1, a.k.a. 7300 PC.  Special procedures are needed to
  367.      compile GNU CC with this machine's standard C compiler, due to
  368.      bugs in that compiler.  You can bootstrap it more easily with
  369.      previous versions of GNU CC if you have them.
  370.      Installing GNU CC on the 3b1 is difficult if you do not already
  371.      have GNU CC running, due to bugs in the installed C compiler.
  372.      However, the following procedure might work.  We are unable to
  373.      test it.
  374.        1. Comment out the `#include "config.h"' line on line 37 of
  375.           `cccp.c' and do `make cpp'.  This makes a preliminary version
  376.           of GNU cpp.
  377.        2. Save the old `/lib/cpp' and copy the preliminary GNU cpp to
  378.           that file name.
  379.        3. Undo your change in `cccp.c', or reinstall the original
  380.           version, and do `make cpp' again.
  381.        4. Copy this final version of GNU cpp into `/lib/cpp'.
  382.        5. Replace every occurrence of `obstack_free' in the file
  383.           `tree.c' with `_obstack_free'.
  384.        6. Run `make' to get the first-stage GNU CC.
  385.        7. Reinstall the original version of `/lib/cpp'.
  386.        8. Now you can compile GNU CC with itself and install it in the
  387.           normal fashion.
  388. `m68k-bull-sysv'
  389.      Bull DPX/2 series 200 and 300 with BOS-2.00.45 up to BOS-2.01. GNU
  390.      CC works either with native assembler or GNU assembler. You can use
  391.      GNU assembler with native coff generation by providing
  392.      `--with-gnu-as' to the configure script or use GNU assembler with
  393.      dbx-in-coff encapsulation by providing `--with-gnu-as --stabs'.
  394.      For any problem with native assembler or for availability of the
  395.      DPX/2 port of GAS, contact `F.Pierresteguy@frcl.bull.fr'.
  396. `m68k-crds-unox'
  397.      Use `configure unos' for building on Unos.
  398.      The Unos assembler is named `casm' instead of `as'.  For some
  399.      strange reason linking `/bin/as' to `/bin/casm' changes the
  400.      behavior, and does not work.  So, when installing GNU CC, you
  401.      should install the following script as `as' in the subdirectory
  402.      where the passes of GCC are installed:
  403.           #!/bin/sh
  404.           casm $*
  405.      The default Unos library is named `libunos.a' instead of `libc.a'.
  406.      To allow GNU CC to function, either change all references to
  407.      `-lc' in `gcc.c' to `-lunos' or link `/lib/libc.a' to
  408.      `/lib/libunos.a'.
  409.      When compiling GNU CC with the standard compiler, to overcome bugs
  410.      in the support of `alloca', do not use `-O' when making stage 2.
  411.      Then use the stage 2 compiler with `-O' to make the stage 3
  412.      compiler.  This compiler will have the same characteristics as the
  413.      usual stage 2 compiler on other systems.  Use it to make a stage 4
  414.      compiler and compare that with stage 3 to verify proper
  415.      compilation.
  416.      (Perhaps simply defining `ALLOCA' in `x-crds' as described in the
  417.      comments there will make the above paragraph superfluous.  Please
  418.      inform us of whether this works.)
  419.      Unos uses memory segmentation instead of demand paging, so you
  420.      will need a lot of memory.  5 Mb is barely enough if no other
  421.      tasks are running.  If linking `cc1' fails, try putting the object
  422.      files into a library and linking from that library.
  423. `m68k-hp-hpux'
  424.      HP 9000 series 300 or 400 running HP-UX.  HP-UX version 8.0 has a
  425.      bug in the assembler that prevents compilation of GNU CC.  To fix
  426.      it, get patch PHCO_4484 from HP.
  427.      In addition, if you wish to use gas `--with-gnu-as' you must use
  428.      gas version 2.1 or later, and you must use the GNU linker version
  429.      2.1 or later.  Earlier versions of gas relied upon a program which
  430.      converted the gas output into the native HP/UX format, but that
  431.      program has not been kept up to date.  gdb does not understand
  432.      that native HP/UX format, so you must use gas if you wish to use
  433.      gdb.
  434. `m68k-sun'
  435.      Sun 3.  We do not provide a configuration file to use the Sun FPA
  436.      by default, because programs that establish signal handlers for
  437.      floating point traps inherently cannot work with the FPA.
  438.      See *Note Sun Install::, for information on installing GNU CC on
  439.      Sun systems.
  440. `m88k-*-svr3'
  441.      Motorola m88k running the AT&T/Unisoft/Motorola V.3 reference port.
  442.      These systems tend to use the Green Hills C, revision 1.8.5, as the
  443.      standard C compiler.  There are apparently bugs in this compiler
  444.      that result in object files differences between stage 2 and stage
  445.      3.  If this happens, make the stage 4 compiler and compare it to
  446.      the stage 3 compiler.  If the stage 3 and stage 4 object files are
  447.      identical, this suggests you encountered a problem with the
  448.      standard C compiler; the stage 3 and 4 compilers may be usable.
  449.      It is best, however, to use an older version of GNU CC for
  450.      bootstrapping if you have one.
  451. `m88k-*-dgux'
  452.      Motorola m88k running DG/UX.  To build 88open BCS native or cross
  453.      compilers on DG/UX, specify the configuration name as
  454.      `m88k-*-dguxbcs' and build in the 88open BCS software development
  455.      environment.  To build ELF native or cross compilers on DG/UX,
  456.      specify `m88k-*-dgux' and build in the DG/UX ELF development
  457.      environment.  You set the software development environment by
  458.      issuing `sde-target' command and specifying either `m88kbcs' or
  459.      `m88kdguxelf' as the operand.
  460.      If you do not specify a configuration name, `configure' guesses the
  461.      configuration based on the current software development
  462.      environment.
  463. `m88k-tektronix-sysv3'
  464.      Tektronix XD88 running UTekV 3.2e.  Do not turn on optimization
  465.      while building stage1 if you bootstrap with the buggy Green Hills
  466.      compiler.  Also, The bundled LAI System V NFS is buggy so if you
  467.      build in an NFS mounted directory, start from a fresh reboot, or
  468.      avoid NFS all together.  Otherwise you may have trouble getting
  469.      clean comparisons between stages.
  470. `mips-mips-bsd'
  471.      MIPS machines running the MIPS operating system in BSD mode.  It's
  472.      possible that some old versions of the system lack the functions
  473.      `memcpy', `memcmp', and `memset'.  If your system lacks these, you
  474.      must remove or undo the definition of `TARGET_MEM_FUNCTIONS' in
  475.      `mips-bsd.h'.
  476.      The MIPS C compiler needs to be told to increase its table size
  477.      for switch statements with the `-Wf,-XNg1500' option in order to
  478.      compile `cp/parse.c'.  If you use the `-O2' optimization option,
  479.      you also need to use `-Olimit 3000'.  Both of these options are
  480.      automatically generated in the `Makefile' that the shell script
  481.      `configure' builds.  If you override the `CC' make variable and
  482.      use the MIPS compilers, you may need to add `-Wf,-XNg1500 -Olimit
  483.      3000'.
  484. `mips-mips-riscos*'
  485.      The MIPS C compiler needs to be told to increase its table size
  486.      for switch statements with the `-Wf,-XNg1500' option in order to
  487.      compile `cp/parse.c'.  If you use the `-O2' optimization option,
  488.      you also need to use `-Olimit 3000'.  Both of these options are
  489.      automatically generated in the `Makefile' that the shell script
  490.      `configure' builds.  If you override the `CC' make variable and
  491.      use the MIPS compilers, you may need to add `-Wf,-XNg1500 -Olimit
  492.      3000'.
  493.      MIPS computers running RISC-OS can support four different
  494.      personalities: default, BSD 4.3, System V.3, and System V.4 (older
  495.      versions of RISC-OS don't support V.4).  To configure GCC for
  496.      these platforms use the following configurations:
  497.     `mips-mips-riscos`rev''
  498.           Default configuration for RISC-OS, revision `rev'.
  499.     `mips-mips-riscos`rev'bsd'
  500.           BSD 4.3 configuration for RISC-OS, revision `rev'.
  501.     `mips-mips-riscos`rev'sysv4'
  502.           System V.4 configuration for RISC-OS, revision `rev'.
  503.     `mips-mips-riscos`rev'sysv'
  504.           System V.3 configuration for RISC-OS, revision `rev'.
  505.      The revision `rev' mentioned above is the revision of RISC-OS to
  506.      use.  You must reconfigure GCC when going from a RISC-OS revision
  507.      4 to RISC-OS revision 5.  This has the effect of avoiding a linker
  508.      bug (see *Note Installation Problems::, for more details).
  509. `mips-sgi-*'
  510.      In order to compile GCC on an SGI running IRIX 4, the "c.hdr.lib"
  511.      option must be installed from the CD-ROM supplied from Silicon
  512.      Graphics.  This is found on the 2nd CD in release 4.0.1.
  513.      In order to compile GCC on an SGI running IRIX 5, the
  514.      "compiler_dev.hdr" subsystem must be installed from the IDO CD-ROM
  515.      supplied by Silicon Graphics.
  516.      `make compare' may fail on version 5 of IRIX unless you add
  517.      `-save-temps' to `CFLAGS'.  On these systems, the name of the
  518.      assembler input file is stored in the object file, and that makes
  519.      comparison fail if it differs between the `stage1' and `stage2'
  520.      compilations.  The option `-save-temps' forces a fixed name to be
  521.      used for the assembler input file, instead of a randomly chosen
  522.      name in `/tmp'.  Do not add `-save-temps' unless the comparisons
  523.      fail without that option.  If you do you `-save-temps', you will
  524.      have to manually delete the `.i' and `.s' files after each series
  525.      of compilations.
  526.      The MIPS C compiler needs to be told to increase its table size
  527.      for switch statements with the `-Wf,-XNg1500' option in order to
  528.      compile `cp/parse.c'.  If you use the `-O2' optimization option,
  529.      you also need to use `-Olimit 3000'.  Both of these options are
  530.      automatically generated in the `Makefile' that the shell script
  531.      `configure' builds.  If you override the `CC' make variable and
  532.      use the MIPS compilers, you may need to add `-Wf,-XNg1500 -Olimit
  533.      3000'.
  534.      On Irix version 4.0.5F, and perhaps on some other versions as well,
  535.      there is an assembler bug that reorders instructions incorrectly.
  536.      To work around it, specify the target configuration
  537.      `mips-sgi-irix4loser'.  This configuration inhibits assembler
  538.      optimization.
  539.      In a compiler configured with target `mips-sgi-irix4', you can turn
  540.      off assembler optimization by using the `-noasmopt' option.  This
  541.      compiler option passes the option `-O0' to the assembler, to
  542.      inhibit reordering.
  543.      The `-noasmopt' option can be useful for testing whether a problem
  544.      is due to erroneous assembler reordering.  Even if a problem does
  545.      not go away with `-noasmopt', it may still be due to assembler
  546.      reordering--perhaps GNU CC itself was miscompiled as a result.
  547.      To enable debugging under Irix 5, you must use GNU as 2.5 or later,
  548.      and use the `--with-gnu-as' configure option when configuring gcc.
  549.      GNU as is distributed as part of the binutils package.
  550. `mips-sony-sysv'
  551.      Sony MIPS NEWS.  This works in NEWSOS 5.0.1, but not in 5.0.2
  552.      (which uses ELF instead of COFF).  Support for 5.0.2 will probably
  553.      be provided soon by volunteers.  In particular, the linker does
  554.      not like the code generated by GCC when shared libraries are
  555.      linked in.
  556. `ns32k-encore'
  557.      Encore ns32000 system.  Encore systems are supported only under
  558.      BSD.
  559. `ns32k-*-genix'
  560.      National Semiconductor ns32000 system.  Genix has bugs in `alloca'
  561.      and `malloc'; you must get the compiled versions of these from GNU
  562.      Emacs.
  563. `ns32k-sequent'
  564.      Go to the Berkeley universe before compiling.  In addition, you
  565.      probably need to create a file named `string.h' containing just
  566.      one line: `#include <strings.h>'.
  567. `ns32k-utek'
  568.      UTEK ns32000 system ("merlin").  The C compiler that comes with
  569.      this system cannot compile GNU CC; contact `tektronix!reed!mason'
  570.      to get binaries of GNU CC for bootstrapping.
  571. `romp-*-aos'
  572. `romp-*-mach'
  573.      The only operating systems supported for the IBM RT PC are AOS and
  574.      MACH.  GNU CC does not support AIX running on the RT.  We
  575.      recommend you compile GNU CC with an earlier version of itself; if
  576.      you compile GNU CC with `hc', the Metaware compiler, it will work,
  577.      but you will get mismatches between the stage 2 and stage 3
  578.      compilers in various files.  These errors are minor differences in
  579.      some floating-point constants and can be safely ignored; the stage
  580.      3 compiler is correct.
  581. `rs6000-*-aix'
  582. `powerpc-*-aix'
  583.      Various early versions of each release of the IBM XLC compiler
  584.      will not bootstrap GNU CC.  Symptoms include differences between
  585.      the stage2 and stage3 object files, and errors when compiling
  586.      `libgcc.a' or `enquire'.  Known problematic releases include:
  587.      xlc-1.2.1.8, xlc-1.3.0.0 (distributed with AIX 3.2.5), and
  588.      xlc-1.3.0.19.  Both xlc-1.2.1.28 and xlc-1.3.0.24 (PTF 432238) are
  589.      known to produce working versions of GNU CC, but most other recent
  590.      releases correctly bootstrap GNU CC.  Also, releases of AIX prior
  591.      to AIX 3.2.4 include a version of the IBM assembler which does not
  592.      accept debugging directives: assembler updates are available as
  593.      PTFs.  See the file `README.RS6000' for more details on both of
  594.      these problems.
  595.      Only AIX is supported on the PowerPC.  GNU CC does not yet support
  596.      the 64-bit PowerPC instructions.
  597.      Objective C does not work on this architecture.
  598.      AIX on the RS/6000 provides support (NLS) for environments outside
  599.      of the United States.  Compilers and assemblers use NLS to support
  600.      locale-specific representations of various objects including
  601.      floating-point numbers ("." vs "," for separating decimal
  602.      fractions).  There have been problems reported where the library
  603.      linked with GNU CC does not produce the same floating-point
  604.      formats that the assembler accepts.  If you have this problem, set
  605.      the LANG environment variable to "C" or "En_US".
  606. `powerpc-*-elf'
  607. `powerpc-*-sysv4'
  608.      PowerPC system in big endian mode, running System V.4.  This
  609.      system is currently under development.
  610. `powerpc-*-eabi'
  611.      Embedded PowerPC system in big endian mode.  This system is
  612.      currently under development.
  613. `powerpcle-*-elf'
  614. `powerpcle-*-eabi'
  615.      PowerPC system in little endian mode, running System V.4.  This
  616.      system is currently under development.
  617. `powerpcle-*-sysv4'
  618.      Embedded PowerPC system in little endian mode.  This system is
  619.      currently under development.
  620. `vax-dec-ultrix'
  621.      Don't try compiling with Vax C (`vcc').  It produces incorrect code
  622.      in some cases (for example, when `alloca' is used).
  623.      Meanwhile, compiling `cp/parse.c' with pcc does not work because of
  624.      an internal table size limitation in that compiler.  To avoid this
  625.      problem, compile just the GNU C compiler first, and use it to
  626.      recompile building all the languages that you want to run.
  627. `sparc-sun-*'
  628.      See *Note Sun Install::, for information on installing GNU CC on
  629.      Sun systems.
  630. `vax-dec-vms'
  631.      See *Note VMS Install::, for details on how to install GNU CC on
  632.      VMS.
  633. `we32k-*-*'
  634.      These computers are also known as the 3b2, 3b5, 3b20 and other
  635.      similar names.  (However, the 3b1 is actually a 68000; see *Note
  636.      Configurations::.)
  637.      Don't use `-g' when compiling with the system's compiler.  The
  638.      system's linker seems to be unable to handle such a large program
  639.      with debugging information.
  640.      The system's compiler runs out of capacity when compiling `stmt.c'
  641.      in GNU CC.  You can work around this by building `cpp' in GNU CC
  642.      first, then use that instead of the system's preprocessor with the
  643.      system's C compiler to compile `stmt.c'.  Here is how:
  644.           mv /lib/cpp /lib/cpp.att
  645.           cp cpp /lib/cpp.gnu
  646.           echo '/lib/cpp.gnu -traditional ${1+"$@"}' > /lib/cpp
  647.           chmod +x /lib/cpp
  648.      The system's compiler produces bad code for some of the GNU CC
  649.      optimization files.  So you must build the stage 2 compiler without
  650.      optimization.  Then build a stage 3 compiler with optimization.
  651.      That executable should work.  Here are the necessary commands:
  652.           make LANGUAGES=c CC=stage1/xgcc CFLAGS="-Bstage1/ -g"
  653.           make stage2
  654.           make CC=stage2/xgcc CFLAGS="-Bstage2/ -g -O"
  655.      You may need to raise the ULIMIT setting to build a C++ compiler,
  656.      as the file `cc1plus' is larger than one megabyte.
  657. File: gcc.info,  Node: Other Dir,  Next: Cross-Compiler,  Prev: Configurations,  Up: Installation
  658. Compilation in a Separate Directory
  659. ===================================
  660.    If you wish to build the object files and executables in a directory
  661. other than the one containing the source files, here is what you must
  662. do differently:
  663.   1. Make sure you have a version of Make that supports the `VPATH'
  664.      feature.  (GNU Make supports it, as do Make versions on most BSD
  665.      systems.)
  666.   2. If you have ever run `configure' in the source directory, you must
  667.      undo the configuration.  Do this by running:
  668.           make distclean
  669.   3. Go to the directory in which you want to build the compiler before
  670.      running `configure':
  671.           mkdir gcc-sun3
  672.           cd gcc-sun3
  673.      On systems that do not support symbolic links, this directory must
  674.      be on the same file system as the source code directory.
  675.   4. Specify where to find `configure' when you run it:
  676.           ../gcc/configure ...
  677.      This also tells `configure' where to find the compiler sources;
  678.      `configure' takes the directory from the file name that was used to
  679.      invoke it.  But if you want to be sure, you can specify the source
  680.      directory with the `--srcdir' option, like this:
  681.           ../gcc/configure --srcdir=../gcc OTHER OPTIONS
  682.      The directory you specify with `--srcdir' need not be the same as
  683.      the one that `configure' is found in.
  684.    Now, you can run `make' in that directory.  You need not repeat the
  685. configuration steps shown above, when ordinary source files change.  You
  686. must, however, run `configure' again when the configuration files
  687. change, if your system does not support symbolic links.
  688. File: gcc.info,  Node: Cross-Compiler,  Next: Sun Install,  Prev: Other Dir,  Up: Installation
  689. Building and Installing a Cross-Compiler
  690. ========================================
  691.    GNU CC can function as a cross-compiler for many machines, but not
  692.    * Cross-compilers for the Mips as target using the Mips assembler
  693.      currently do not work, because the auxiliary programs
  694.      `mips-tdump.c' and `mips-tfile.c' can't be compiled on anything
  695.      but a Mips.  It does work to cross compile for a Mips if you use
  696.      the GNU assembler and linker.
  697.    * Cross-compilers between machines with different floating point
  698.      formats have not all been made to work.  GNU CC now has a floating
  699.      point emulator with which these can work, but each target machine
  700.      description needs to be updated to take advantage of it.
  701.    * Cross-compilation between machines of different word sizes is
  702.      somewhat problematic and sometimes does not work.
  703.    Since GNU CC generates assembler code, you probably need a
  704. cross-assembler that GNU CC can run, in order to produce object files.
  705. If you want to link on other than the target machine, you need a
  706. cross-linker as well.  You also need header files and libraries suitable
  707. for the target machine that you can install on the host machine.
  708. * Menu:
  709. * Steps of Cross::      Using a cross-compiler involves several steps
  710.                           that may be carried out on different machines.
  711. * Configure Cross::     Configuring a cross-compiler.
  712. * Tools and Libraries:: Where to put the linker and assembler, and the C library.
  713. * Cross Headers::       Finding and installing header files
  714.                           for a cross-compiler.
  715. * Cross Runtime::       Supplying arithmetic runtime routines (`libgcc1.a').
  716. * Build Cross::         Actually compiling the cross-compiler.
  717. File: gcc.info,  Node: Steps of Cross,  Next: Configure Cross,  Up: Cross-Compiler
  718. Steps of Cross-Compilation
  719. --------------------------
  720.    To compile and run a program using a cross-compiler involves several
  721. steps:
  722.    * Run the cross-compiler on the host machine to produce assembler
  723.      files for the target machine.  This requires header files for the
  724.      target machine.
  725.    * Assemble the files produced by the cross-compiler.  You can do this
  726.      either with an assembler on the target machine, or with a
  727.      cross-assembler on the host machine.
  728.    * Link those files to make an executable.  You can do this either
  729.      with a linker on the target machine, or with a cross-linker on the
  730.      host machine.  Whichever machine you use, you need libraries and
  731.      certain startup files (typically `crt....o') for the target
  732.      machine.
  733.    It is most convenient to do all of these steps on the same host
  734. machine, since then you can do it all with a single invocation of GNU
  735. CC.  This requires a suitable cross-assembler and cross-linker.  For
  736. some targets, the GNU assembler and linker are available.
  737. File: gcc.info,  Node: Configure Cross,  Next: Tools and Libraries,  Prev: Steps of Cross,  Up: Cross-Compiler
  738. Configuring a Cross-Compiler
  739. ----------------------------
  740.    To build GNU CC as a cross-compiler, you start out by running
  741. `configure'.  Use the `--target=TARGET' to specify the target type.  If
  742. `configure' was unable to correctly identify the system you are running
  743. on, also specify the `--build=BUILD' option.  For example, here is how
  744. to configure for a cross-compiler that produces code for an HP 68030
  745. system running BSD on a system that `configure' can correctly identify:
  746.      ./configure --target=m68k-hp-bsd4.3
  747. File: gcc.info,  Node: Tools and Libraries,  Next: Cross Headers,  Prev: Configure Cross,  Up: Cross-Compiler
  748. Tools and Libraries for a Cross-Compiler
  749. ----------------------------------------
  750.    If you have a cross-assembler and cross-linker available, you should
  751. install them now.  Put them in the directory `/usr/local/TARGET/bin'.
  752. Here is a table of the tools you should put in this directory:
  753.      This should be the cross-assembler.
  754.      This should be the cross-linker.
  755.      This should be the cross-archiver: a program which can manipulate
  756.      archive files (linker libraries) in the target machine's format.
  757. `ranlib'
  758.      This should be a program to construct a symbol table in an archive
  759.      file.
  760.    The installation of GNU CC will find these programs in that
  761. directory, and copy or link them to the proper place to for the
  762. cross-compiler to find them when run later.
  763.    The easiest way to provide these files is to build the Binutils
  764. package and GAS.  Configure them with the same `--host' and `--target'
  765. options that you use for configuring GNU CC, then build and install
  766. them.  They install their executables automatically into the proper
  767. directory.  Alas, they do not support all the targets that GNU CC
  768. supports.
  769.    If you want to install libraries to use with the cross-compiler,
  770. such as a standard C library, put them in the directory
  771. `/usr/local/TARGET/lib'; installation of GNU CC copies all all the
  772. files in that subdirectory into the proper place for GNU CC to find
  773. them and link with them.  Here's an example of copying some libraries
  774. from a target machine:
  775.      ftp TARGET-MACHINE
  776.      lcd /usr/local/TARGET/lib
  777.      cd /lib
  778.      get libc.a
  779.      cd /usr/lib
  780.      get libg.a
  781.      get libm.a
  782.      quit
  783. The precise set of libraries you'll need, and their locations on the
  784. target machine, vary depending on its operating system.
  785.    Many targets require "start files" such as `crt0.o' and `crtn.o'
  786. which are linked into each executable; these too should be placed in
  787. `/usr/local/TARGET/lib'.  There may be several alternatives for
  788. `crt0.o', for use with profiling or other compilation options.  Check
  789. your target's definition of `STARTFILE_SPEC' to find out what start
  790. files it uses.  Here's an example of copying these files from a target
  791. machine:
  792.      ftp TARGET-MACHINE
  793.      lcd /usr/local/TARGET/lib
  794.      prompt
  795.      cd /lib
  796.      mget *crt*.o
  797.      cd /usr/lib
  798.      mget *crt*.o
  799.      quit
  800. File: gcc.info,  Node: Cross Runtime,  Next: Build Cross,  Prev: Cross Headers,  Up: Cross-Compiler
  801. `libgcc.a' and Cross-Compilers
  802. ------------------------------
  803.    Code compiled by GNU CC uses certain runtime support functions
  804. implicitly.  Some of these functions can be compiled successfully with
  805. GNU CC itself, but a few cannot be.  These problem functions are in the
  806. source file `libgcc1.c'; the library made from them is called
  807. `libgcc1.a'.
  808.    When you build a native compiler, these functions are compiled with
  809. some other compiler-the one that you use for bootstrapping GNU CC.
  810. Presumably it knows how to open code these operations, or else knows how
  811. to call the run-time emulation facilities that the machine comes with.
  812. But this approach doesn't work for building a cross-compiler.  The
  813. compiler that you use for building knows about the host system, not the
  814. target system.
  815.    So, when you build a cross-compiler you have to supply a suitable
  816. library `libgcc1.a' that does the job it is expected to do.
  817.    To compile `libgcc1.c' with the cross-compiler itself does not work.
  818. The functions in this file are supposed to implement arithmetic
  819. operations that GNU CC does not know how to open code for your target
  820. machine.  If these functions are compiled with GNU CC itself, they will
  821. compile into infinite recursion.
  822.    On any given target, most of these functions are not needed.  If GNU
  823. CC can open code an arithmetic operation, it will not call these
  824. functions to perform the operation.  It is possible that on your target
  825. machine, none of these functions is needed.  If so, you can supply an
  826. empty library as `libgcc1.a'.
  827.    Many targets need library support only for multiplication and
  828. division.  If you are linking with a library that contains functions for
  829. multiplication and division, you can tell GNU CC to call them directly
  830. by defining the macros `MULSI3_LIBCALL', and the like.  These macros
  831. need to be defined in the target description macro file.  For some
  832. targets, they are defined already.  This may be sufficient to avoid the
  833. need for libgcc1.a; if so, you can supply an empty library.
  834.    Some targets do not have floating point instructions; they need other
  835. functions in `libgcc1.a', which do floating arithmetic.  Recent
  836. versions of GNU CC have a file which emulates floating point.  With a
  837. certain amount of work, you should be able to construct a floating
  838. point emulator that can be used as `libgcc1.a'.  Perhaps future
  839. versions will contain code to do this automatically and conveniently.
  840. That depends on whether someone wants to implement it.
  841.    Some embedded targets come with all the necessary `libgcc1.a'
  842. routines written in C or assembler.  These targets build `libgcc1.a'
  843. automatically and you do not need to do anything special for them.
  844. Other embedded targets do not need any `libgcc1.a' routines since all
  845. the necessary operations are supported by the hardware.
  846.    If your target system has another C compiler, you can configure GNU
  847. CC as a native compiler on that machine, build just `libgcc1.a' with
  848. `make libgcc1.a' on that machine, and use the resulting file with the
  849. cross-compiler.  To do this, execute the following on the target
  850. machine:
  851.      cd TARGET-BUILD-DIR
  852.      ./configure --host=sparc --target=sun3
  853.      make libgcc1.a
  854. And then this on the host machine:
  855.      ftp TARGET-MACHINE
  856.      binary
  857.      cd TARGET-BUILD-DIR
  858.      get libgcc1.a
  859.      quit
  860.    Another way to provide the functions you need in `libgcc1.a' is to
  861. define the appropriate `perform_...' macros for those functions.  If
  862. these definitions do not use the C arithmetic operators that they are
  863. meant to implement, you should be able to compile them with the
  864. cross-compiler you are building.  (If these definitions already exist
  865. for your target file, then you are all set.)
  866.    To build `libgcc1.a' using the perform macros, use
  867. `LIBGCC1=libgcc1.a OLDCC=./xgcc' when building the compiler.
  868. Otherwise, you should place your replacement library under the name
  869. `libgcc1.a' in the directory in which you will build the
  870. cross-compiler, before you run `make'.
  871. File: gcc.info,  Node: Cross Headers,  Next: Cross Runtime,  Prev: Tools and Libraries,  Up: Cross-Compiler
  872. Cross-Compilers and Header Files
  873. --------------------------------
  874.    If you are cross-compiling a standalone program or a program for an
  875. embedded system, then you may not need any header files except the few
  876. that are part of GNU CC (and those of your program).  However, if you
  877. intend to link your program with a standard C library such as `libc.a',
  878. then you probably need to compile with the header files that go with
  879. the library you use.
  880.    The GNU C compiler does not come with these files, because (1) they
  881. are system-specific, and (2) they belong in a C library, not in a
  882. compiler.
  883.    If the GNU C library supports your target machine, then you can get
  884. the header files from there (assuming you actually use the GNU library
  885. when you link your program).
  886.    If your target machine comes with a C compiler, it probably comes
  887. with suitable header files also.  If you make these files accessible
  888. from the host machine, the cross-compiler can use them also.
  889.    Otherwise, you're on your own in finding header files to use when
  890. cross-compiling.
  891.    When you have found suitable header files, put them in
  892. `/usr/local/TARGET/include', before building the cross compiler.  Then
  893. installation will run fixincludes properly and install the corrected
  894. versions of the header files where the compiler will use them.
  895.    Provide the header files before you build the cross-compiler, because
  896. the build stage actually runs the cross-compiler to produce parts of
  897. `libgcc.a'.  (These are the parts that *can* be compiled with GNU CC.)
  898. Some of them need suitable header files.
  899.    Here's an example showing how to copy the header files from a target
  900. machine.  On the target machine, do this:
  901.      (cd /usr/include; tar cf - .) > tarfile
  902.    Then, on the host machine, do this:
  903.      ftp TARGET-MACHINE
  904.      lcd /usr/local/TARGET/include
  905.      get tarfile
  906.      quit
  907.      tar xf tarfile
  908.